local osZhian = fk.CreateSkill {
    name = "gai__zhian"
  }
  
  Fk:loadTranslationTable{
    ["gai__zhian"] = "治暗",
    [":gai__zhian"] = "每回合限一次，当一名角色使用装备牌结算结束后，你可选择一项：1. 从场上弃置此牌；2. 弃置一张手牌，获得此牌。",
  
    ["os__zhian_discard"] = "从场上弃置%arg",
    ["os__zhian_get"] = "弃置一张手牌，获得%arg",
    ["#os__zhian-ask"] = "治暗：%dest 使用了%arg，你可选择一项",
  
    ["$gai__zhian1"] = "此等蝼蚁不除，必溃千丈之堤！",
    ["$gai__zhian2"] = "尔等权贵贪赃枉法，岂可轻饶？！",
  }
  
  osZhian:addEffect(fk.CardUseFinished, {
    can_trigger = function(self, event, target, player, data)
      return
        player:hasSkill(osZhian.name) and
        target ~= player and
        (data.card.type == Card.TypeEquip ) and
        player:usedSkillTimes(osZhian.name) < 1
    end,
    on_cost = function(self, event, target, player, data)
      local choices = {}
      local room = player.room
      local card_area = room:getCardArea(data.card)
      if card_area == Card.PlayerEquip  then
        table.insert(choices, "os__zhian_discard:::" .. data.card:toLogString())
      end
      if not player:isKongcheng() then 
        table.insert(choices, "os__zhian_get:::" .. data.card:toLogString())
      end
      local choice = room:askToChoice(
        player,
        {
          choices = choices,
          skill_name = osZhian.name,
          prompt = "#os__zhian-ask::" .. target.id .. ":" .. data.card:toLogString(),
        }
      )
      if choice ~= "Cancel" then
        event:setCostData(self, choice)
        return true
      end
      return false
    end,
    on_use = function(self, event, target, player, data)
      ---@type string
      local skillName = osZhian.name
      local room = player.room
      room:doIndicate(player, { target })
      local choice = event:getCostData(self)
      if choice:startsWith("os__zhian_discard") then
        local card = data.card
        local owner = room:getCardOwner(card)
        room:throwCard(Card:getIdList(card), skillName, owner, player)
      elseif choice:startsWith("os__zhian_get") then
        room:askToDiscard(
          player,
          {
            min_num = 1,
            max_num = 1,
            skill_name = skillName,
            cancelable = false,
          }
        )
        room:obtainCard(player, data.card, false, fk.ReasonPrey, player, skillName)
      end
    end
  })
  
  return osZhian